# -*- coding: utf-8 -*-
from utils.operators.spark_submit import SparkSubmitOperator
from jms.ods import jms_ods__jms_outfield_app_log_info

es__jms_outfield_app_log_info = SparkSubmitOperator(
    task_id='es__jms_outfield_app_log_info',
    email=['wangmenglei@jtexpress.com','yl_bigdata@yl-scm.com'],
    pool_slots=1,
    # depends_on_past=True,  # 如果任务依赖于前一天的同名任务，则将 depends_on_past 设为 True
    task_concurrency=1,  # 如果任务不支持并发，则将 task_concurrency 设为 1
    name='es__jms_outfield_app_log_info_{{ execution_date | date_add(1) | cst_ds }}',  # yarn 任务名称
    driver_memory='2G' , 
    executor_memory='2G' , 
    executor_cores=2 , 
    num_executors=2 , 
    jars='hdfs:///scheduler/jms/spark/chk/jmslog/jms_outfield_app_log_info/pro/common-1.0-SNAPSHOT.jar',  # 依赖 jar 包
    java_class='com.jms.yl.main.WcAppLogHive2Es',  # spark 主类
    application='hdfs:///scheduler/jms/spark/chk/jmslog/jms_outfield_app_log_info/pro/batch_process-1.0-SNAPSHOT-jar-with-dependencies.jar',
    # spark jar 包
    application_args=['{{ execution_date | cst_ds }}'],  # 参数dt T-1天
)

# 设置依赖
es__jms_outfield_app_log_info << jms_ods__jms_outfield_app_log_info
